package 对象之多态.多态的步骤.demo;


public class test {
    public static void main(String[] args) {
        Dog a = new Dog();
        a.setName("史迪奇");
        showAnimal(a);

//        Animal animal =new Dog();


        Mouse b = new Mouse();
        b.setName("杰瑞");

        showAnimal(b);
    }

    public static void showAnimal(Animal an) {
        an.eat();

    }

   /* public  static void showAnimal(Dog Q) {
        Q.eat();


    }
    public  static void showAnimal( Mouse Q) {
        Q.eat();


    }*/
}
